package cn.aitstone.feign;

import cn.aitstone.entity.Store;
import cn.aitstone.utils.AjaxResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class StoreFeignClientFallbackFactory1 implements FallbackFactory<StoreFeignClient> {


    @Override
    public StoreFeignClient create(Throwable throwable) {
        return new StoreFeignClient() {
            @Override
            public AjaxResult add(Store store) {
                return AjaxResult.me().setMessage("降级了").setSuccess(false);
            }
        };

    }
}
